package com.hina.rec.application.convert.system;

import com.hina.rec.domain.model.SettleDetailDO;
import com.hina.rec.endpoint.req.system.SettleDetailSaveReq;
import com.hina.rec.endpoint.req.system.SettleDetailUpdateReq;
import com.hina.rec.endpoint.res.system.SettleDetailRes;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

/**
 * 结算明细数据转换接口
 *
 * @author liaosp
 * @date 2024-01-05
 */
@Mapper
public interface SettleDetailConvert {

    SettleDetailConvert INSTANCE = Mappers.getMapper(SettleDetailConvert.class);

    /**
     * 将保存请求转换为DO
     *
     * @param req 保存请求
     * @return DO对象
     */
    SettleDetailDO toSettleDetailDO(SettleDetailSaveReq req);

    /**
     * 将更新请求转换为DO
     *
     * @param req 更新请求
     * @return DO对象
     */
    SettleDetailDO toSettleDetailDO(SettleDetailUpdateReq req);

    /**
     * 将DO转换为响应对象
     *
     * @param settleDetailDO DO对象
     * @return 响应对象
     */
    SettleDetailRes toSettleDetailRes(SettleDetailDO settleDetailDO);
}